package cn.sciento.boot.tenant.autoconfigure;

import cn.sciento.boot.tenant.hiam.app.service.HiamTenantInitService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class TenantInitRedisValueInit implements InitializingBean {
  @Autowired
  HiamTenantInitService hiamTenantInitService;
  
  @Autowired
  TenantInitProperties tenantInitProperties;
  
  @Override
  public void afterPropertiesSet() {
    if (this.tenantInitProperties != null && this.hiamTenantInitService != null && this.tenantInitProperties.getAspect().isEnabled()) {
      this.hiamTenantInitService.refreshTenantInitConfigCatch();
    }
  }
}
